<template>
  <el-table :data="userRoles" stripe style="width: 100%">
    <el-table-column prop="id" label="Id" width="100" />
    <el-table-column prop="name" label="角色名称" width="200" />
    <el-table-column prop="description" label="角色描述" />
  </el-table>
</template>

<script setup>
import { ref, onMounted } from 'vue'
import axios from 'axios'

const userRoles = ref([])

onMounted(() => {
  const api = 'api/user-roles/all'
  axios.get(api)
  .then(res => {
    userRoles.value = res.data;
  })
})
</script>